cmake_minimum_required(VERSION 2.6)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(graphics)

# find library
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

if (64BIT)
add_definitions(-D__64BIT__)
endif()

if (WIN)
add_definitions(-D__WINDOWS__)
add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-W3)
endif()

if (DEBUG)
add_definitions(-D__DEBUG__)
endif()

set(graphics_SOURCES
	graphics/Type.hpp
	graphics/Root.hpp
	graphics/EventDelegate.hpp
	graphics/LibraryLoader.hpp
	graphics/RenderLoader.hpp
	graphics/Component.hpp
	graphics/graphics/Scene.hpp
	graphics/graphics/SceneNode.hpp
	graphics/graphics/SceneManager.hpp
	graphics/graphics/scenenode/Camera.hpp
	graphics/graphics/scenenode/Light.hpp
	graphics/graphics/scenenode/GraphicsNode.hpp
	graphics/graphics/component/Mesh.hpp
	graphics/graphics/component/MeshRenderer.hpp
	graphics/graphics/component/Material.hpp
	graphics/graphics/render/Render.hpp
	graphics/graphics/render/RenderWindow.hpp
	
	src/Root.cc
	src/RenderLoader.cc
	src/Component.cc
	src/graphics/Scene.cc
	src/graphics/SceneNode.cc
	src/graphics/SceneManager.cc
	src/graphics/scenenode/Camera.cc
	src/graphics/scenenode/Light.cc
	src/graphics/scenenode/GraphicsNode.cc
	src/graphics/component/Mesh.cc
	src/graphics/component/MeshRenderer.cc
	src/graphics/component/Material.cc
)

if (WIN)
set(plat_SRC
	src/WinLibraryLoader.cc
)
endif()

include_directories( 
	${PROJECT_SOURCE_DIR}
)

add_library(graphics STATIC ${graphics_SOURCES} ${plat_SRC})